#ifndef _SYNTHUNITS_H_
#define _SYNTHUNITS_H_

#include "Unit.h"

class Noise : public Unit
{
   private:
      Message mLast;

   public:
      Noise()
      {
         createPorts(1, 0);
      }
      void ar(unsigned port, sample_t *buf, jack_nframes_t len, Options options);
};

class Gain : public Unit
{
   private:
      float mGain;

   public:
      Gain()
      {
         createPorts(1, 1);
      }
      void ar(unsigned port, sample_t *buf, jack_nframes_t len, Options options);
      inline Gain& setGain(float g) { mGain = g; return *this; }
      float getGain() { return mGain; }
};

class SinOsc : public Unit
{
   private:
      uint64_t       mPhase;
      float          mFreq;

   public:
      SinOsc()
      {
         mPhase = 0;
         createPorts(1, 1);
      }
      inline SinOsc& setFreq(float freq) { mFreq = freq; return *this; }
      inline SinOsc& setPhase(uint64_t phase) { mPhase = phase; return *this; }
      void ar(unsigned portNum, sample_t *buf, jack_nframes_t len, Options opt);
      float getFreq() { return mFreq; }
};

#endif
